<template>
	<view  class="theme_bg_vice_color">
		<z-paging ref="paging" v-model="dataList" fixed @query="queryList">
			<view slot="top" class="theme_bg_color">
				<cu-custom id="nav" :isBack="true" :backColor="'text-black'">
					<block slot="backText">
						<view class="text-black ">
							紧急拼车列表
						</view>
					</block>
				</cu-custom>
				<!-- <scroll-view id="dateWeek" class="scroll-view_H b-t b-b scroll-view1" scroll-x>
					<block v-for="(item,index) in dateArr" :key="index">
						<div class="flex-box" @click="selectDateEvent(index,item)"
							:style="{'border-bottom':index==dateActive ? '2px solid  #fbbd08' : ''}">
							<view class="date-box" :style="{color:index==dateActive?selectedTabColor:'#8a8a8d'}">
								<text style="font-weight: bold;">{{item.week}}{{index==dateActive?'('+count+')':''}}</text>
								<text>{{item.date}}</text>
							</view>
						</div>
					</block>
				</scroll-view> -->
			</view>
			<view class="grarg">
				<view class="cu-card article">
					<view @click="$goPage('../../pageB/script/AppointmentProgress?id='+item.id)"
						class="cu-item shadow padding-sm theme_bg_color" style="position: relative;"
						v-for="(item,index) in dataList" :key="index"
						>
						<!-- <image src="../../static/icon/zd.png" class="zd" mode=""></image> -->
						<view class="flex justify-start">
							<image :src="$isHttp(item.picture)"
								style="width: 210rpx;height: 290rpx;border-radius: 10rpx;" mode="aspectFill"></image>
							<view class=" margin-left-sm" style="width: 520rpx;">
								<view class="flex justify-start margin-top-xs">
									<view class="text-bold text-black">{{item.name}}</view>
									<!-- <view class="cu-tag bg-yellow  sm round margin-left-sm">标签666</view> -->
								</view>
								<view class="margin-top-sm">
									<view v-for="(item1,index1) in item.smallclass" :key="index1"
										class="cu-tag sm round" style="background-color: #3f3f3f;color: #b2b1b6;"
										v-if="index1<6">{{item1.small_name}}</view>
								</view>
								<view class="margin-top-sm">
									<view class="cu-tag sm round">时间：{{item.date}}【{{item.week}}】{{item.time}}</view>
								</view>
								<view class="margin-top-sm flex justify-start" style="color: #b2b1b6;">
									<view class="flex justify-start align-center">
										<text class="cuIcon-friendfill text-yellow"></text>
										<view class="text-sm margin-left-xs">{{item.sex_type}}</view>
									</view>
									<view class="flex justify-start align-center margin-left-sm">
										<text class="cuIcon-timefill text-yellow"></text>
										<view class="text-sm margin-left-xs">{{item.hour}}小时</view>
									</view>
									<view class="flex justify-start align-center margin-left-sm">
										<text class="cuIcon-selectionfill text-yellow"></text>
										<view class="text-sm margin-left-xs">{{item.difficulty}}</view>
									</view>
								</view>
								<view class="flex justify-between  margin-top-sm">
									<view class="flex align-start" style="color: #b2b1b6;">
										<view class="text-sm">门店：<text style="text-decoration: underline"
												@click="$goPage('../business/info?id='+item.storeId)">{{item.storeName}}</text>
										</view>
									</view>
									<view class="cu-btn bg-yellow sm round text-white">组队中
										{{item.Joincount}}/{{item.people}}</view>
								</view>
							</view>
						</view>
					</view>
				</view>
			</view>
		</z-paging>
	</view>
</template>

<script>
	import {
		dateData,
		timeData,
		timeStamp,
		currentTime
	} from '../../components/utils/date.js'
	import ZPagingMixin from '@/uni_modules/z-paging/components/z-paging/js/z-paging-mixin'
	export default {
		//注意这一步不要漏掉，必须注册mixins(如果全局引入了，就不要这一步，全局引入示例见main.js)
		mixins: [ZPagingMixin],
		data() {
			return {
				value: '',
				dataList: [],

				color: '#292929',
				hasChoose: false,

				dateArr: [], //日期数据
				dateActive: 0, //选中的日期索引
				selectedTabColor: "#fbbd08", // 日期栏选中的颜色
				count:0,
			};
		},
		onShow() {
			this.setOnload()
		},
		methods: {
			queryList(pageNo, pageSize) {
				//组件加载时会自动触发此方法，因此默认页面加载时会自动触发，无需手动调用
				//这里的pageNo和pageSize会自动计算好，直接传给服务器即可
				//模拟请求服务器获取分页数据，请替换成自己的网络请求
				this.$u.api.getPinList({
					page: pageNo,
					number: pageSize,
					date: '',
					arr:'',
					city:this.vuex_city,
					select:1,
					
					name:'',
					store_Name:'',
				}).then(res => {
					this.$refs.paging.complete(res.data.list);
					this.count=res.data.count
				})
			},
			setOnload() {
				this.dateArr = dateData() // 日期栏初始化
			},
			selectDateEvent(index, item) {
				console.log(index, item)
				this.dateActive = index
				this.queryList(1, 10)
			},

		},

	}
</script>

<style lang="scss" scoped>
	.zd {
		position: absolute;
		top: 0;
		left: 0;
		width: 60rpx;
		height: 55rpx;
		z-index: 1;
	}

	// .grarg {
	// 	position: absolute;
	// 	top: 225rpx;
	// 	bottom: 100rpx;
	// }

	.box_whbrc {
		width: 90rpx;
		height: 60rpx;
		border-radius: 30rpx;
		// background-color: #cfa526;
		margin-right: 20rpx;
		text-align: center;
		line-height: 60rpx;
	}

	.bgc_cfa526 {
		background-color: #cfa526;
	}

	.scroll-view_H {
		white-space: nowrap;
		width: 100%;
	}

	.scroll-view-item_H {
		display: inline-block;
	}

	.scroll-view1 {
		width: 100%;
		white-space: nowrap;
		height: 75px;
		background-color: #1f2025;
		position: relative;
		padding-top: 10px;

		// margin-top:10px;
		&::after {
			// background: #e5e5e5;
			content: '';
			display: block;
			width: 100%;
			height: 1px;
			position: absolute;
			bottom: 0;
			left: 0;
			transform: scaleY(0.5);

		}

		.flex-box {
			display: inline-block;
			height: 60px;
			width: 25%;
			margin: 0 7rpx 0 7rpx;
			box-sizing: border-box;

			&.active {
				.date-box {
					border: none;

					.days {
						font-weight: bold;
						color: #a6a6a6;
					}

					.date {
						font-weight: bold;
						color: #a6a6a6;
					}
				}
			}

			.date-box {
				border: none;
				display: flex;
				height: 50px;
				flex-direction: column;
				align-items: center;
				justify-content: space-around;
				font-size: 30upx;
				color: rgba(129, 129, 129, 1);

				.date {
					font-weight: bold;
					color: #a6a6a6;
					font-size: 30upx;

				}
			}
		}

	}
</style>
